package com.zsrt.java.day20161223.lh.homework1223.Demo10;

import org.junit.Test;

public class table99 {
	
	
	/**
	 * 用while打印99乘法表
	 * 
	 * @throws Exception
	 */
	@Test
	public void testName() throws Exception {
		int begin=1;
		int end=9;
		//行
		while(begin<=end){
			int i=1;
			//列
			while(i<=begin){
				System.out.print(begin+"*"+i+"="+(begin*i)+"\t");
				//步长
				i++;
			}
			//步长
			begin++;
			System.out.println();
		}
		
	}
	
	
	/**
	 * 用do while打印99乘法表   2
	 * 
	 */
	
	@Test
	public void testName02() throws Exception {
		int begin=1;
		int end=9;
		//行
		do{
			int i=1;
			//列
			do{
				System.out.print(begin+"*"+i+"="+(begin*i)+"\t");
				//步长
				i++;
			}while(i<begin);
				
			//步长
			begin++;
			System.out.println();
		}while(begin<=end);
	}

}


